<template>
  <div>
    <div class="container">
          <div class="user_banner">
      <div class="nav_box">
        <div class="nav_title">我的易购</div>
        <div class="nav_rigth" @click="$router.push('/set')">
          <img src="@/assets/setting.png" alt="" />
        </div>
      </div>
      <!-- 用户信息 -->
      <div class="user_info">
        <div class="user_logo">
          <a href="javascript:;" class="headLogo">
            <img :src="$store.state.user.url" alt="" />
          </a>
          <a href="javascript" class="realName">去实名认证</a>
        </div>
        <div class="user_detail">
          <div class="user_name">{{$store.state.user.nick}}</div>
          <div class="user_content">生态值240</div>
        </div>
        <div class="user_code">
          <img src="@/assets/qr-icon.png" alt="" />
        </div>
      </div>

      <!-- 钱包 -->
      <div class="sn_money">
        <div class="money_item">
          <b>0</b>
          <span>优惠券</span>
        </div>
        <div class="money_item">
          <b>0</b>
          <span>领云钻</span>
        </div>
        <div class="money_item">
          <b>0</b>
          <span>足迹</span>
        </div>
        <div class="money_item">
          <b>0</b>
          <span>我的关注</span>
        </div>
      </div>

      <!-- vipbox -->
      <div class="vip">
        <div class="vip_item">
          <img src="@/assets/vip.png" alt="" />
        </div>
        <div class="vip_title">银行联名卡, 办卡得Super</div>
        <div class="vip_views">
          <span>立即查看</span>
          <i></i>
        </div>
      </div>
    </div>
    <!-- 订单 -->
    <div class="user_order order_box">
      <div class="box_title">
        <span>我的订单</span>
        <div class="view_all">
          <a href="javasctipt:;">查看全部&nbsp;
            <i></i>
          </a>
        </div>
      </div>
      <div class="box_order">
        <a href="javascript:;">
          <i class="order_1"></i>
          <span>待支付</span>
        </a>
           <a href="javascript:;">
          <i class="order_2"></i>
          <span>待收货</span>
        </a>
           <a href="javascript:;">
          <i class="order_3"></i>
          <span>评价有礼</span>
        </a>
           <a href="javascript:;">
          <i class="order_4"></i>
          <span>退换/售后</span>
        </a>
        <a href="javascript:;">
          <i class="order_5"></i>
          <span>常购清单</span>
        </a>

      </div>
    </div>

    <!-- tools -->
    <div class="order_box">
      <div class="box_title">
        <span>必备工具</span>
      </div>
      <div class="box_icon">
        <a href="">
          <img src="../../assets/157250874743127029.png" alt="">
          <span>红包</span>
        </a>
           <a href="">
          <img src="../../assets//157250876042530564.png" alt="">
          <span>店铺关注</span>
        </a>
           <a href="">
         <img src="../../assets/tool3.png" alt="">
          <span>我的预约</span>
        </a>
           <a href="">
          <img src="../../assets/toosl4.png" alt="">
          <span>客户服务</span>
        </a>
           <a href="">
          <img src="../../assets//tools5.png" alt="">
          <span>必抢清单</span>
        </a>
           <a href="">
          <img src="../../assets//tool6.png" alt="">
          <span>拼购</span>
        </a>
           <a href="">
          <img src="../../assets/tool8.png" alt="">
          <span>校园vip</span>
        </a>
           <a href="">
          <img src="../../assets/tool9.png" alt="">
          <span>我的使用</span>
        </a>
      </div>
    </div>
    </div>

    <tabbar></tabbar>
  </div>
</template>

<script>
import { userDetail } from '_api'
import { getToken } from '_utils/token.js'
import Tabbar from '../../components/Tabbar.vue'
export default {
  components: { Tabbar },
  data () {
    return {
      nick: ''
    }
  },
  created () {
    // this.userDetail()
  },
  methods: {
    // 用了vux 这里暂时不用
    // userDetail () {
    //   userDetail({
    //     token: getToken()
    //   }).then(res => {
    //     console.log(res)
    //     if (res.data.code === 0) {
    //       this.nick = res.data.data.base.nick
    //       this.url = res.data.data.base.avatarUrl
    //     }
    //   })
    // }
  }
}
</script>

<style lang="scss" scoped>
.container{
  padding-bottom: 1.333333rem;
}
.user_banner {
  position: relative;
  height: 5.493333rem;
  width: 100%;
  background-color: #ffd847;
}
.nav_box {
  height: 0.613333rem;
  padding-top: 0.24rem;
  text-align: center;
  .nav_title {
    font-size: 0.48rem;
    color: #000;
    font-weight: 700;
  }
  .nav_rigth {
    position: absolute;
    right: 0;
    top: 0;
    width: 0.56rem;
    height: 0.56rem;
    top: 0.266667rem;
    right: 0.4rem;
    img {
      width: 100%;
      height: 100%;
    }
  }
}
.user_info {
  padding: 0.706667rem 0.56rem 0;
  display: flex;
  .user_logo {
    position: relative;
    .headLogo {
      img {
        display: inline-block;
        width: 1.6rem;
        height: 1.6rem;
        border-radius: 0.8rem;
        border: 0.013333rem solid #fff;
      }
    }
    .realName {
      position: absolute;
      left: -0.133333rem;
      bottom: 0.026667rem;
      width: 1.893333rem;
      height: 0.4rem;
      // line-height: .426667rem;
      background-color: #ffeac3;
      border-radius: 0.093333rem;
      font-size: 0.266667rem;
      color: #222;
      text-align: center;
      line-height: 0.4rem;
    }
  }
}

.user_detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  margin-left: 0.4rem;
  .user_name {
    max-width: 2rem;
    height: 0.56rem;
    margin-bottom: 0.16rem;
    font-size: 0.373333rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .user_content {
    height: 0.4rem;
    padding: 0 0.16rem;
    background-color: #e1bb23;
    color: #fff;
    border-radius: 0.2rem;
    font-size: 0.266667rem;
    line-height: 0.4rem;
    text-align: center;
  }
}
.user_code {
  width: 1.6rem;
  height: 1.6rem;
  img {
    width: 100%;
    height: 100%;
  }
}

.sn_money {
  display: flex;
  height: 2.333333rem;
  width: 100%;
  overflow: hidden;
  justify-content: space-between;
  .money_item {
    width: 25%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    b {
      font-size: 0.4rem;
      font-weight: bold;
      color: #222;
    }
    span {
      font-size: 0.346667rem;
      color: #222;
    }
  }
}
.vip {
  width: 8.773333rem;
  height: 0.826667rem;
  padding: 0.186667rem 0.32rem 0.186667rem 0.266667rem;
  margin: -0.4rem 0.32rem 0 0.32rem;
  background-color: #fff;
  border-radius: 0.293333rem;
  display: flex;
  align-items: center;
  &_item {
    width: 1.2rem;
    height: 0.8rem;
    img{
      width: 100%;
    }
  }
  &_title{
    width: 5.066667rem;
    font-size: .32rem;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    height: .48rem;
    line-height: .48rem;
    margin-left: .133333rem;
  }
  &_views{
    position: relative;
    left:.666667rem;
    display: flex;
    align-items: center;
    justify-content: center;
    span{
      font-size: .32rem;
    }
    i{
          display: inline-block;
    width: .4rem;
    height: .4rem;
    background:url('../../assets/r-icon.png') no-repeat;
    background-size: contain;
    }
  }
}

.user_order{
  margin-top: 1.12rem !important;
  margin-bottom: .32rem !important;
}
.order_box{
  width: 8.6rem;
  padding: .32rem;
  margin: auto;
  background-color: #fff;
  border-radius: .533333rem;
}
.box_title{
  width: 100%;
  height: .453333rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .4rem;
  color: #2222;
  font-weight: 700;
  span{
    color: #222;
  }
  .view_all{

    a{
    font-size: .32rem;
    color: #666;
        display: flex;
    align-items: center;
    }
    i{
      display: inline-block;
      width: .32rem;
      height: .32rem;
      background:url('../../assets/next.png') no-repeat;
      background-size: contain;
    }

  }
}
.box_order{
  height: 2.346667rem;
  display: flex;
  justify-content: space-around;
  align-items: center;
  a{
    display: flex;
    width: 20%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    i{
      width: .8rem;
      height: .8rem;
      margin-bottom: .173333rem;

    }
    .order_1{
      background:url('../../assets/order-icon01.png') no-repeat;
       background-size: contain;
    }
       .order_2{
      background:url('../../assets/order-icon02.png') no-repeat;
        background-size: contain;
    }
       .order_3{
      background:url('../../assets/order-icon03.png') no-repeat;
        background-size: contain;
    }
       .order_4{
      background:url('../../assets/order-icon04.png') no-repeat;
        background-size: contain;
    }
       .order_5{
      background:url('../../assets/order-icon05.png') no-repeat;
        background-size: contain;
    }
    span{
      font-size: .32rem;
      color:#666;
    }
  }
}
.box_icon{
  display: flex;
  flex-wrap: wrap;
  a{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.573333rem;
    flex-direction: column;
    margin-top: .373333rem;
    width: 25%;
    img{
      width: .64rem;
      height: .64rem;

      margin-bottom: .213333rem;
    }
    span{
      font-size: .32rem;
      color: #222;
    }
  }
}
</style>
